﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Entities.Portals;
    using Microsoft.VisualBasic;
    using System;
    using System.Web;

    public abstract class ChequeInterface
    {
        private static ChequeInterface objProvider = null;

        static ChequeInterface()
        {
            CreateProvider();
        }

        public abstract void CompleteOrder(int PortalID, int OrderID, string Lang, bool UpdateStock);
        private static void CreateProvider()
        {
            SettingsController controller = new SettingsController();
            string[] strArray = Strings.Split(controller.GetSetting(((PortalSettings) HttpContext.Current.Items["PortalSettings"]).PortalId, "encapsulated.provider", "XX").SettingValue, ",", -1, CompareMethod.Binary);
            objProvider = (ChequeInterface) Activator.CreateInstance(strArray[0], strArray[1]).Unwrap();
        }

        public static ChequeInterface Instance()
        {
            return objProvider;
        }
    }
}

